package com.bw.services.device.model

import com.bw.services.model.ServicesApiServer
import com.bw.services.model.ServicesRepo
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object DeviceModule {
    @Singleton
    @Provides
    fun getDeviceApiServer(retrofit: Retrofit): DeviceApiServer =retrofit.create(
        DeviceApiServer::class.java)

    @Singleton
    @Provides
    fun getDeviceRepo(apiServer: DeviceApiServer): DeviceRepo {
        return  DeviceRepo(apiServer)
    }
}